/**
 * 
 */
package com.gragra.nounIdentification.tests;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import com.gragra.nounIdentification.ConvergenceByIterations;
/**
 * @author Christoph Teichmann
 * created Mar 28, 2013 8:12:35 PM
 * @version 0.1
 */
public class TestConvergenceByIterations
{
	/**
	 * 
	 */
	private ConvergenceByIterations cbi1;
	/**
	 * 
	 */
	private ConvergenceByIterations cbi2;
	/**
	 *
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception
	{
		cbi1 = new ConvergenceByIterations(3);
		cbi2 = new ConvergenceByIterations(5);
	}
	/**
	 * Test method for {@link com.gragra.nounIdentification.ConvergenceByIterations#hasConverged(int, com.gragra.nounIdentification.NounIdentifier)}.
	 */
	@Test
	public final void testHasConverged()
	{
		int i = 0;
		assertFalse(cbi1.hasConverged(i, null));
		assertFalse(cbi2.hasConverged(i++, null));
		assertFalse(cbi1.hasConverged(i, null));
		assertFalse(cbi2.hasConverged(i++, null));
		assertFalse(cbi1.hasConverged(i, null));
		assertFalse(cbi2.hasConverged(i++, null));
		assertTrue(cbi1.hasConverged(i, null));
		assertFalse(cbi2.hasConverged(i++, null));
		assertTrue(cbi1.hasConverged(i, null));
		assertFalse(cbi2.hasConverged(i++, null));
		assertTrue(cbi1.hasConverged(i, null));
		assertTrue(cbi2.hasConverged(i++, null));
		assertTrue(cbi1.hasConverged(i, null));
		assertTrue(cbi2.hasConverged(i++, null));
		assertTrue(cbi1.hasConverged(i, null));
		assertTrue(cbi2.hasConverged(i++, null));
	}
}